package com.leyou.user.service.init;

import com.leyou.user.service.service.AuthorizeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @author zqq
 * @ClassName StartupRunner
 * @Description: 启动执行类，加载所有权限
 * @date 2020/3/24-16:55
 */
@Component
@Slf4j
@Order(value = 2)
public class StartupRunner implements CommandLineRunner {

    @Autowired
    private AuthorizeService authorizeService;

    @Override
    public void run(String... args) throws Exception {
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>服务初始化开始<<<<<<<<<<<<<<<<<<<<<");
        authorizeService.loadRedisAuthorize();
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>服务初始化结束<<<<<<<<<<<<<<<<<<<<<");
    }
}
